package com.atguigu.spzx.common.exception;

import com.atguigu.spzx.model.vo.common.ResultCodeEnum;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;

//自定义异常：业务判断失败时手动抛出、出现编译时/运行时 的系统异常时 转为自定义的运行时异常抛出
@Getter
public class SpzxException extends RuntimeException{

    private String message;
    private Integer code;
    private Exception e;

    public SpzxException(Integer code ,String message , Exception e){
        super(message);
        this.code = code;
        this.message = message;
        this.e = e;
    }
    public SpzxException(ResultCodeEnum codeEnum, Exception e){
        this(codeEnum.getCode(), codeEnum.getMessage() , e);
    }

}
